Encapsulation: which means data hiding OR binding

   Encapsulation is defined as the wrapping up of data under a single unit. It is the mechanism that binds together code and the data it manipulates.
   
Other way to think about encapsulation is, it is a protective shield that prevents the data from being accessed by the code outside this shield.

Best example for Encapsulation is private members.

Bcoz the private members can be accessed within the same class only. But private members of the one class can't be accessed in another independent class OR inheritance.


Q: How to access the private members outside the class?
Ans: By default we can't access the private members outside the class. Bcoz private members are accessible within the same class.

But using setter & getter approach we can access the private members outside the class.

